home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Two-dimens204718292007.psc / 2 d array any class final / 2 d array any class previous version / myarray.frm < prev    next >
Text File  |  2007-02-08  |  23KB  |  721 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    AutoRedraw      =   -1  'True
  4.    BackColor       =   &H00FFFFFF&
  5.    BorderStyle     =   5  'Sizable ToolWindow
  6.    Caption         =   "2d array class"
  7.    ClientHeight    =   7764
  8.    ClientLeft      =   48
  9.    ClientTop       =   288
  10.    ClientWidth     =   10104
  11.    BeginProperty Font 
  12.       Name            =   "MS Sans Serif"
  13.       Size            =   9.6
  14.       Charset         =   0
  15.       Weight          =   400
  16.       Underline       =   0   'False
  17.       Italic          =   0   'False
  18.       Strikethrough   =   0   'False
  19.    EndProperty
  20.    LinkTopic       =   "Form1"
  21.    MaxButton       =   0   'False
  22.    MinButton       =   0   'False
  23.    ScaleHeight     =   647
  24.    ScaleMode       =   3  'Pixel
  25.    ScaleWidth      =   842
  26.    ShowInTaskbar   =   0   'False
  27.    StartUpPosition =   2  'CenterScreen
  28.    Begin VB.CommandButton Command1 
  29.       BackColor       =   &H00C0FFFF&
  30.       Caption         =   "new"
  31.       BeginProperty Font 
  32.          Name            =   "MS Sans Serif"
  33.          Size            =   12
  34.          Charset         =   0
  35.          Weight          =   700
  36.          Underline       =   0   'False
  37.          Italic          =   0   'False
  38.          Strikethrough   =   0   'False
  39.       EndProperty
  40.       Height          =   372
  41.       Index           =   11
  42.       Left            =   8520
  43.       Style           =   1  'Graphical
  44.       TabIndex        =   32
  45.       Top             =   840
  46.       Width           =   1332
  47.    End
  48.    Begin VB.CommandButton Command1 
  49.       BackColor       =   &H00C0E0FF&
  50.       Caption         =   "cut range"
  51.       BeginProperty Font 
  52.          Name            =   "MS Sans Serif"
  53.          Size            =   12
  54.          Charset         =   0
  55.          Weight          =   700
  56.          Underline       =   0   'False
  57.          Italic          =   0   'False
  58.          Strikethrough   =   0   'False
  59.       EndProperty
  60.       Height          =   372
  61.       Index           =   10
  62.       Left            =   6600
  63.       Style           =   1  'Graphical
  64.       TabIndex        =   31
  65.       Top             =   7200
  66.       Width           =   3372
  67.    End
  68.    Begin VB.TextBox Text1 
  69.       BeginProperty Font 
  70.          Name            =   "MS Sans Serif"
  71.          Size            =   12
  72.          Charset         =   0
  73.          Weight          =   700
  74.          Underline       =   0   'False
  75.          Italic          =   0   'False
  76.          Strikethrough   =   0   'False
  77.       EndProperty
  78.       Height          =   492
  79.       Index           =   15
  80.       Left            =   3960
  81.       TabIndex        =   28
  82.       Text            =   "8"
  83.       Top             =   5400
  84.       Width           =   732
  85.    End
  86.    Begin VB.TextBox Text1 
  87.       BeginProperty Font 
  88.          Name            =   "MS Sans Serif"
  89.          Size            =   12
  90.          Charset         =   0
  91.          Weight          =   700
  92.          Underline       =   0   'False
  93.          Italic          =   0   'False
  94.          Strikethrough   =   0   'False
  95.       EndProperty
  96.       Height          =   492
  97.       Index           =   14
  98.       Left            =   2760
  99.       TabIndex        =   26
  100.       Text            =   "3"
  101.       Top             =   5400
  102.       Width           =   732
  103.    End
  104.    Begin VB.TextBox Text1 
  105.       BeginProperty Font 
  106.          Name            =   "MS Sans Serif"
  107.          Size            =   12
  108.          Charset         =   0
  109.          Weight          =   700
  110.          Underline       =   0   'False
  111.          Italic          =   0   'False
  112.          Strikethrough   =   0   'False
  113.       EndProperty
  114.       Height          =   492
  115.       Index           =   13
  116.       Left            =   2040
  117.       TabIndex        =   25
  118.       Text            =   "2"
  119.       Top             =   5400
  120.       Width           =   732
  121.    End
  122.    Begin VB.CommandButton Command1 
  123.       BackColor       =   &H00808080&
  124.       Caption         =   "Set item"
  125.       BeginProperty Font 
  126.          Name            =   "MS Sans Serif"
  127.          Size            =   12
  128.          Charset         =   0
  129.          Weight          =   700
  130.          Underline       =   0   'False
  131.          Italic          =   0   'False
  132.          Strikethrough   =   0   'False
  133.       EndProperty
  134.       Height          =   372
  135.       Index           =   9
  136.       Left            =   120
  137.       Style           =   1  'Graphical
  138.       TabIndex        =   24
  139.       Top             =   5400
  140.       Width           =   1812
  141.    End
  142.    Begin VB.CommandButton Command1 
  143.       BackColor       =   &H00FFC0C0&
  144.       Caption         =   "Set Range to Value"
  145.       BeginProperty Font 
  146.          Name            =   "MS Sans Serif"
  147.          Size            =   12
  148.          Charset         =   0
  149.          Weight          =   700
  150.          Underline       =   0   'False
  151.          Italic          =   0   'False
  152.          Strikethrough   =   0   'False
  153.       EndProperty
  154.       Height          =   372
  155.       Index           =   8
  156.       Left            =   5760
  157.       Style           =   1  'Graphical
  158.       TabIndex        =   23
  159.       Top             =   5640
  160.       Width           =   3252
  161.    End
  162.    Begin VB.TextBox Text1 
  163.       BeginProperty Font 
  164.          Name            =   "MS Sans Serif"
  165.          Size            =   12
  166.          Charset         =   0
  167.          Weight          =   700
  168.          Underline       =   0   'False
  169.          Italic          =   0   'False
  170.          Strikethrough   =   0   'False
  171.       EndProperty
  172.       Height          =   492
  173.       Index           =   12
  174.       Left            =   9240
  175.       TabIndex        =   22
  176.       Text            =   "8"
  177.       Top             =   5520
  178.       Width           =   732
  179.    End
  180.    Begin VB.CommandButton Command1 
  181.       Caption         =   "new lower bound rows"
  182.       BeginProperty Font 
  183.          Name            =   "MS Sans Serif"
  184.          Size            =   12
  185.          Charset         =   0
  186.          Weight          =   700
  187.          Underline       =   0   'False
  188.          Italic          =   0   'False
  189.          Strikethrough   =   0   'False
  190.       EndProperty
  191.       Height          =   372
  192.       Index           =   7
  193.       Left            =   6120
  194.       TabIndex        =   21
  195.       Top             =   3360
  196.       Width           =   2772
  197.    End
  198.    Begin VB.TextBox Text1 
  199.       BeginProperty Font 
  200.          Name            =   "MS Sans Serif"
  201.          Size            =   12
  202.          Charset         =   0
  203.          Weight          =   700
  204.          Underline       =   0   'False
  205.          Italic          =   0   'False
  206.          Strikethrough   =   0   'False
  207.       EndProperty
  208.       Height          =   492
  209.       Index           =   11
  210.       Left            =   9120
  211.       TabIndex        =   20
  212.       Text            =   "8"
  213.       Top             =   3360
  214.       Width           =   732
  215.    End
  216.    Begin VB.TextBox Text1 
  217.       BeginProperty Font 
  218.          Name            =   "MS Sans Serif"
  219.          Size            =   12
  220.          Charset         =   0
  221.          Weight          =   700
  222.          Underline       =   0   'False
  223.          Italic          =   0   'False
  224.          Strikethrough   =   0   'False
  225.       EndProperty
  226.       Height          =   492
  227.       Index           =   10
  228.       Left            =   9120
  229.       TabIndex        =   19
  230.       Text            =   "8"
  231.       Top             =   2160
  232.       Width           =   732
  233.    End
  234.    Begin VB.CommandButton Command1 
  235.       Caption         =   "new lower bound cols"
  236.       BeginProperty Font 
  237.          Name            =   "MS Sans Serif"
  238.          Size            =   12
  239.          Charset         =   0
  240.          Weight          =   700
  241.          Underline       =   0   'False
  242.          Italic          =   0   'False
  243.          Strikethrough   =   0   'False
  244.       EndProperty
  245.       Height          =   372
  246.       Index           =   6
  247.       Left            =   6120
  248.       TabIndex        =   18
  249.       Top             =   2760
  250.       Width           =   2772
  251.    End
  252.    Begin VB.TextBox Text1 
  253.       BeginProperty Font 
  254.          Name            =   "MS Sans Serif"
  255.          Size            =   12
  256.          Charset         =   0
  257.          Weight          =   700
  258.          Underline       =   0   'False
  259.          Italic          =   0   'False
  260.          Strikethrough   =   0   'False
  261.       EndProperty
  262.       Height          =   492
  263.       Index           =   9
  264.       Left            =   9120
  265.       TabIndex        =   17
  266.       Text            =   "8"
  267.       Top             =   2760
  268.       Width           =   732
  269.    End
  270.    Begin VB.CommandButton Command1 
  271.       BackColor       =   &H00E0E0E0&
  272.       Caption         =   "redim preserve rows"
  273.       BeginProperty Font 
  274.          Name            =   "MS Sans Serif"
  275.          Size            =   12
  276.          Charset         =   0
  277.          Weight          =   700
  278.          Underline       =   0   'False
  279.          Italic          =   0   'False
  280.          Strikethrough   =   0   'False
  281.       EndProperty
  282.       Height          =   372
  283.       Index           =   5
  284.       Left            =   6120
  285.       Style           =   1  'Graphical
  286.       TabIndex        =   16
  287.       Top             =   2160
  288.       Width           =   2772
  289.    End
  290.    Begin VB.TextBox Text1 
  291.       BeginProperty Font 
  292.          Name            =   "MS Sans Serif"
  293.          Size            =   12
  294.          Charset         =   0
  295.          Weight          =   700
  296.          Underline       =   0   'False
  297.          Italic          =   0   'False
  298.          Strikethrough   =   0   'False
  299.       EndProperty
  300.       Height          =   492
  301.       Index           =   8
  302.       Left            =   9120
  303.       TabIndex        =   15
  304.       Text            =   "8"
  305.       Top             =   1680
  306.       Width           =   732
  307.    End
  308.    Begin VB.CommandButton Command1 
  309.       BackColor       =   &H00E0E0E0&
  310.       Caption         =   "redim preserve cols"
  311.       BeginProperty Font 
  312.          Name            =   "MS Sans Serif"
  313.          Size            =   12
  314.          Charset         =   0
  315.          Weight          =   700
  316.          Underline       =   0   'False
  317.          Italic          =   0   'False
  318.          Strikethrough   =   0   'False
  319.       EndProperty
  320.       Height          =   372
  321.       Index           =   4
  322.       Left            =   6120
  323.       Style           =   1  'Graphical
  324.       TabIndex        =   14
  325.       Top             =   1680
  326.       Width           =   2772
  327.    End
  328.    Begin VB.TextBox Text1 
  329.       BeginProperty Font 
  330.          Name            =   "MS Sans Serif"
  331.          Size            =   12
  332.          Charset         =   0
  333.          Weight          =   700
  334.          Underline       =   0   'False
  335.          Italic          =   0   'False
  336.          Strikethrough   =   0   'False
  337.       EndProperty
  338.       Height          =   492
  339.       Index           =   7
  340.       Left            =   7680
  341.       TabIndex        =   12
  342.       Text            =   "4"
  343.       Top             =   5040
  344.       Width           =   732
  345.    End
  346.    Begin VB.TextBox Text1 
  347.       BeginProperty Font 
  348.          Name            =   "MS Sans Serif"
  349.          Size            =   12
  350.          Charset         =   0
  351.          Weight          =   700
  352.          Underline       =   0   'False
  353.          Italic          =   0   'False
  354.          Strikethrough   =   0   'False
  355.       EndProperty
  356.       Height          =   492
  357.       Index           =   6
  358.       Left            =   7680
  359.       TabIndex        =   11
  360.       Text            =   "1"
  361.       Top             =   4560
  362.       Width           =   732
  363.    End
  364.    Begin VB.TextBox Text1 
  365.       BeginProperty Font 
  366.          Name            =   "MS Sans Serif"
  367.          Size            =   12
  368.          Charset         =   0
  369.          Weight          =   700
  370.          Underline       =   0   'False
  371.          Italic          =   0   'False
  372.          Strikethrough   =   0   'False
  373.       EndProperty
  374.       Height          =   492
  375.       Index           =   5
  376.       Left            =   9120
  377.       TabIndex        =   10
  378.       Text            =   "4"
  379.       Top             =   4080
  380.       Width           =   732
  381.    End
  382.    Begin VB.TextBox Text1 
  383.       BeginProperty Font 
  384.          Name            =   "MS Sans Serif"
  385.          Size            =   12
  386.          Charset         =   0
  387.          Weight          =   700
  388.          Underline       =   0   'False
  389.          Italic          =   0   'False
  390.          Strikethrough   =   0   'False
  391.       EndProperty
  392.       Height          =   492
  393.       Index           =   4
  394.       Left            =   8400
  395.       TabIndex        =   9
  396.       Text            =   "1"
  397.       Top             =   4080
  398.       Width           =   732
  399.    End
  400.    Begin VB.CommandButton Command1 
  401.       BackColor       =   &H00C0C0C0&
  402.       Caption         =   "sort range horizontal descending"
  403.       BeginProperty Font 
  404.          Name            =   "MS Sans Serif"
  405.          Size            =   12
  406.          Charset         =   0
  407.          Weight          =   700
  408.          Underline       =   0   'False
  409.          Italic          =   0   'False
  410.          Strikethrough   =   0   'False
  411.       EndProperty
  412.       Height          =   372
  413.       Index           =   3
  414.       Left            =   5760
  415.       Style           =   1  'Graphical
  416.       TabIndex        =   7
  417.       Top             =   6720
  418.       Width           =   4212
  419.    End
  420.    Begin VB.CommandButton Command1 
  421.       BackColor       =   &H00C0C0C0&
  422.       Caption         =   "sort range horizontal ascending"
  423.       BeginProperty Font 
  424.          Name            =   "MS Sans Serif"
  425.          Size            =   12
  426.          Charset         =   0
  427.          Weight          =   700
  428.          Underline       =   0   'False
  429.          Italic          =   0   'False
  430.          Strikethrough   =   0   'False
  431.       EndProperty
  432.       Height          =   372
  433.       Index           =   2
  434.       Left            =   5760
  435.       Style           =   1  'Graphical
  436.       TabIndex        =   6
  437.       Top             =   6240
  438.       Width           =   4212
  439.    End
  440.    Begin VB.CommandButton Command1 
  441.       BackColor       =   &H00C0C0C0&
  442.       Caption         =   "sort range vertical descending"
  443.       BeginProperty Font 
  444.          Name            =   "MS Sans Serif"
  445.          Size            =   12
  446.          Charset         =   0
  447.          Weight          =   700
  448.          Underline       =   0   'False
  449.          Italic          =   0   'False
  450.          Strikethrough   =   0   'False
  451.       EndProperty
  452.       Height          =   372
  453.       Index           =   1
  454.       Left            =   1440
  455.       Style           =   1  'Graphical
  456.       TabIndex        =   5
  457.       Top             =   6720
  458.       Width           =   4212
  459.    End
  460.    Begin VB.CommandButton Command1 
  461.       BackColor       =   &H00C0C0C0&
  462.       Caption         =   "sort range vertical ascending"
  463.       BeginProperty Font 
  464.          Name            =   "MS Sans Serif"
  465.          Size            =   12
  466.          Charset         =   0
  467.          Weight          =   700
  468.          Underline       =   0   'False
  469.          Italic          =   0   'False
  470.          Strikethrough   =   0   'False
  471.       EndProperty
  472.       Height          =   372
  473.       Index           =   0
  474.       Left            =   1440
  475.       Style           =   1  'Graphical
  476.       TabIndex        =   4
  477.       Top             =   6240
  478.       Width           =   4212
  479.    End
  480.    Begin VB.TextBox Text1 
  481.       BeginProperty Font 
  482.          Name            =   "MS Sans Serif"
  483.          Size            =   12
  484.          Charset         =   0
  485.          Weight          =   700
  486.          Underline       =   0   'False
  487.          Italic          =   0   'False
  488.          Strikethrough   =   0   'False
  489.       EndProperty
  490.       Height          =   492
  491.       Index           =   3
  492.       Left            =   7680
  493.       TabIndex        =   3
  494.       Text            =   "8"
  495.       Top             =   1200
  496.       Width           =   732
  497.    End
  498.    Begin VB.TextBox Text1 
  499.       BeginProperty Font 
  500.          Name            =   "MS Sans Serif"
  501.          Size            =   12
  502.          Charset         =   0
  503.          Weight          =   700
  504.          Underline       =   0   'False
  505.          Italic          =   0   'False
  506.          Strikethrough   =   0   'False
  507.       EndProperty
  508.       Height          =   492
  509.       Index           =   2
  510.       Left            =   7680
  511.       TabIndex        =   2
  512.       Text            =   "0"
  513.       Top             =   600
  514.       Width           =   732
  515.    End
  516.    Begin VB.TextBox Text1 
  517.       BeginProperty Font 
  518.          Name            =   "MS Sans Serif"
  519.          Size            =   12
  520.          Charset         =   0
  521.          Weight          =   700
  522.          Underline       =   0   'False
  523.          Italic          =   0   'False
  524.          Strikethrough   =   0   'False
  525.       EndProperty
  526.       Height          =   492
  527.       Index           =   1
  528.       Left            =   9240
  529.       TabIndex        =   1
  530.       Text            =   "10"
  531.       Top             =   120
  532.       Width           =   732
  533.    End
  534.    Begin VB.TextBox Text1 
  535.       BeginProperty Font 
  536.          Name            =   "MS Sans Serif"
  537.          Size            =   12
  538.          Charset         =   0
  539.          Weight          =   700
  540.          Underline       =   0   'False
  541.          Italic          =   0   'False
  542.          Strikethrough   =   0   'False
  543.       EndProperty
  544.       Height          =   492
  545.       Index           =   0
  546.       Left            =   8280
  547.       TabIndex        =   0
  548.       Text            =   "2"
  549.       Top             =   120
  550.       Width           =   732
  551.    End
  552.    Begin VB.Shape Shape1 
  553.       Height          =   972
  554.       Left            =   0
  555.       Top             =   5160
  556.       Width           =   5292
  557.    End
  558.    Begin VB.Label Label4 
  559.       BackStyle       =   0  'Transparent
  560.       Caption         =   "row"
  561.       BeginProperty Font 
  562.          Name            =   "MS Sans Serif"
  563.          Size            =   12
  564.          Charset         =   0
  565.          Weight          =   700
  566.          Underline       =   0   'False
  567.          Italic          =   0   'False
  568.          Strikethrough   =   0   'False
  569.       EndProperty
  570.       Height          =   252
  571.       Index           =   1
  572.       Left            =   2040
  573.       TabIndex        =   30
  574.       Top             =   5160
  575.       Width           =   852
  576.    End
  577.    Begin VB.Label Label4 
  578.       BackStyle       =   0  'Transparent
  579.       Caption         =   "col"
  580.       BeginProperty Font 
  581.          Name            =   "MS Sans Serif"
  582.          Size            =   12
  583.          Charset         =   0
  584.          Weight          =   700
  585.          Underline       =   0   'False
  586.          Italic          =   0   'False
  587.          Strikethrough   =   0   'False
  588.       EndProperty
  589.       Height          =   252
  590.       Index           =   0
  591.       Left            =   2760
  592.       TabIndex        =   29
  593.       Top             =   5160
  594.       Width           =   852
  595.    End
  596.    Begin VB.Label Label3 
  597.       BackStyle       =   0  'Transparent
  598.       Caption         =   "to"
  599.       BeginProperty Font 
  600.          Name            =   "MS Sans Serif"
  601.          Size            =   12
  602.          Charset         =   0
  603.          Weight          =   700
  604.          Underline       =   0   'False
  605.          Italic          =   0   'False
  606.          Strikethrough   =   0   'False
  607.       EndProperty
  608.       Height          =   372
  609.       Left            =   3600
  610.       TabIndex        =   27
  611.       Top             =   5520
  612.       Width           =   372
  613.    End
  614.    Begin VB.Label Label2 
  615.       BackStyle       =   0  'Transparent
  616.       Caption         =   "Dimensions:"
  617.       BeginProperty Font 
  618.          Name            =   "MS Sans Serif"
  619.          Size            =   12
  620.          Charset         =   0
  621.          Weight          =   700
  622.          Underline       =   0   'False
  623.          Italic          =   0   'False
  624.          Strikethrough   =   0   'False
  625.       EndProperty
  626.       Height          =   372
  627.       Left            =   6120
  628.       TabIndex        =   13
  629.       Top             =   720
  630.       Width           =   1572
  631.    End
  632.    Begin VB.Label Label1 
  633.       BackStyle       =   0  'Transparent
  634.       Caption         =   "range:"
  635.       BeginProperty Font 
  636.          Name            =   "MS Sans Serif"
  637.          Size            =   12
  638.          Charset         =   0
  639.          Weight          =   700
  640.          Underline       =   0   'False
  641.          Italic          =   0   'False
  642.          Strikethrough   =   0   'False
  643.       EndProperty
  644.       Height          =   492
  645.       Left            =   6120
  646.       TabIndex        =   8
  647.       Top             =   4440
  648.       Width           =   1572
  649.    End
  650. End
  651. Attribute VB_Name = "Form1"
  652. Attribute VB_GlobalNameSpace = False
  653. Attribute VB_Creatable = False
  654. Attribute VB_PredeclaredId = True
  655. Attribute VB_Exposed = False
  656. Dim ARR2D As New Array2d
  657.  
  658. Private Sub Form_Load()
  659. With ARR2D
  660.  
  661. 'set array type method 1
  662. Dim bbb() As String ' or long or date etc
  663. .setvartype bbb
  664. 'or alternative select case version
  665. '.setvartype2 vbstring '
  666.  
  667. .ZeroBaseDimension 5, 5
  668. .SETALL "A"
  669. .setValue 0, 0, "all" '6
  670. .setValue 3, 3, "strings"
  671. .setValue 2, 1, 7
  672. .setRow 1, "8"
  673. .setcol 2, "6"
  674. .DoSwap 1, 1, 3, 3
  675. .doprint Me
  676. End With
  677. End Sub
  678.  
  679. Private Sub Command1_Click(Index As Integer)
  680. With ARR2D
  681. Select Case Index
  682. Case 0
  683. ARR2D.dosort Val(Text1(6)), Val(Text1(4)), Val(Text1(7)), Val(Text1(5)), True, True
  684. Case 1
  685. ARR2D.dosort Val(Text1(6)), Val(Text1(4)), Val(Text1(7)), Val(Text1(5)), True, False
  686. Case 2
  687. ARR2D.dosort Val(Text1(6)), Val(Text1(4)), Val(Text1(7)), Val(Text1(5)), False, True
  688. Case 3
  689. ARR2D.dosort Val(Text1(6)), Val(Text1(4)), Val(Text1(7)), Val(Text1(5)), False, False
  690. Case 4
  691. .redimPreserveCols Val(Text1(8))
  692. Case 5
  693. .redimPreserveROWS Val(Text1(10))
  694. Case 6
  695. .resetColBounds Val(Text1(9))
  696.  
  697. Case 7
  698. .resetRowBounds Val(Text1(11))
  699. Case 8
  700. If .getvartype = vbString Then
  701. .setRange (Text1(6)), (Text1(4)), (Text1(7)), (Text1(5)), (Text1(12))
  702. Else
  703. .setRange Val(Text1(6)), Val(Text1(4)), Val(Text1(7)), Val(Text1(5)), Val(Text1(12))
  704. End If
  705. Case 9
  706. If .getvartype = vbString Then
  707. .setValue (Text1(13)), (Text1(14)), (Text1(15))
  708.  
  709. Else
  710. .setValue Val(Text1(13)), Val(Text1(14)), Val(Text1(15))
  711. End If
  712. Case 10
  713. .cutArray Val(Text1(6)), Val(Text1(4)), Val(Text1(7)), Val(Text1(5))
  714. Case 11
  715. .dimension Val(Text1(2)), Val(Text1(3)), Val(Text1(0)), Val(Text1(1))
  716. End Select
  717. ARR2D.doprint Me
  718. End With
  719. End Sub
  720.  
  721.